import request from '@/utils/request'


export function getUploadProgress(taskId) {
  return request({
    url: '/exec/upload-task/progress/' + taskId,
    method: 'get'
  })
}

export function createUploadTask(data) {
  return request({
    url: '/exec/upload-task/create',
    method: 'post',
    data: data
  })
}


// 多文件上传
export function uploadTempMulti(data) {
  return request({
    url: '/api/file/upload-temp-multi', // 或者使用 /api/file/upload-temp-v2
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}


export function listTask(query) {
  return request({
    url: '/exec/upload-task/list',
    method: 'get',
    params: query
  })
}

// 查询上传任务详细
export function getTask(id,query) {
  return request({
    url: '/exec/upload-task/detail/' + id,
    method: 'get',
    params: query
  })
}

// 删除上传任务
export function delTask(id) {
  return request({
    url: '/exec/upload-task/' + id,
    method: 'delete'
  })
}